import request from '@/utils/request'
import request2 from '@/utils/request2'
import { faceApiUrl }  from "../config"

// 分页查询
export function getPageComBusinessCostMonthly(data) {
  return request({
    url: `${faceApiUrl}/comBusinessCostMonthly/getPageComBusinessCostMonthly`,
    method: 'post',
    data
  })
}

// 详情接口
export function getComBusinessCostMonthlyById(data) {
  return request({
    url: `${faceApiUrl}/comBusinessCostMonthly/getComBusinessCostMonthlyById?id=${data.id}`,
    method: 'get',
  })
}

//导入数据-根据id
export function importMonthlyExcel(data) {
  return request2({
    url: `${faceApiUrl}/comBusinessCostMonthly/importMonthlyExcel`,
    method: 'post',
    data
  }).then(res =>{
    if(res.code=='200'){
    return Promise.resolve(res)
    }
    return Promise.reject(res);
    }).
    catch(err =>{
    return Promise.reject(err);
    })
}
//导出模板-根据id
export function exportMonthlyTemplate(data) {
  return request({
    url: `${faceApiUrl}/comBusinessCostMonthly/exportMonthlyTemplate`,
    method: 'post',
    data: data,
    responseType: 'blob'
  })
}
//修改商务成本信息填报(月度)_基本信息
export function updateByPrimaryKeySelective(data) {
  return request({
    url: `${faceApiUrl}/comBusinessCostMonthly/updateByPrimaryKeySelective`,
    method: 'post',
    data: data,
  })
}
// 导出校验是否发生调整
export function checkExportDetailsChange(data) {
  return request({
    url: `${faceApiUrl}/comBusinessCostMonthly/checkExportDetailsChange?id=${data.id}`,
    method: 'get',
  })
}